<template>
    <el-select :value="value+''"  @input="$emit('input', $event)"  :style="{width: width+'%'}"
      :placeholder="placeholder" clearable default-first-option filterable>
        <el-option v-for="(data,index) in dataList"
            :key="index"
            :label="data.Team_name"
            :value="data.id">
              </el-option>
    </el-select>

</template>
<script>

export default {
  name: 'SelectTeamId',
  data () {
    return {
      dataList: [],
      placeholder: this.$t('custom.component.selectTeamId.placeholder')
    }
  },
  props: {
    value: String,
    width: Number
  },
  created () {
    this.getTeamList()
  },
  methods: {
    getTeamList () {
      this.$interface.reports.getReportDatasetDataApi('1396745976077590530', '')
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.dataList = res.data
        })
    }
    // onChangeTeam (data) {
    //   let item = this.dataList.find(e => e.id === data)
    //   this.$emit('changeTeam', item)
    // }
  }
}
</script>
